<?php
	// 加载公共文件
	include_once('../public/config/config.php');
	include_once('../public/config/sql.php');

	// 实例化对象
	$obj = new sql($info);
?>
<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>	
	<div class="myIframe_box">
		<div class="iframe_title">
			<div class="iframe_title_c">
				<div class="title_c_l">
					<span>文章列表</span>
					<a href="./index.php?param=article_insert">新增文章</a>
					<a href="javascript:;">批量删除</a>	
				</div>

				<div class="mysearch">
					<form id="myform" action="./index.php?param=article_lists" method="post" class="myform">
						<p><input type="text" name="key" placeholder="请输入关键字...."><i class="iconfont icon-sousuo1 " onclick="return $('#myform').submit();"></i></p>
					</form>
				</div>
			</div>
		</div>
		<?php 
			if($count == 0){
				echo '<div class="title_b_hint"><button onclick="return history.back(-1);">返回上一级</button></div>';
			}
		?>

		<div class="middle_box">
			<table class="myTable lable" width="100%" cellspacing="0">
				<thead>
					<tr>
						<th><input type="checkbox" onclick="return checkboxs();">全选/反选</th>
						<th>ID</th>
						<th>图片</th>
						<th>文章分类</th>
						<th>标题</th>
						<th>描述</th>
						<th>内容</th>
						<th>轮播状态</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<?php
						foreach($articleList as $val){

							$state = $val['state'] === '1' ? '异常' : '正常';

							$slide = $val['slide'] === '1' ? '是' : '否';
							// 查询文章分类
							$sql = "select id,username from article_classify where id=?";

							$cUser = $obj->db_select($sql, false, null, null, null, $val['cid']);

							echo '<tr>'.
									'<th><input class="checkedse" type="checkbox" name="id[]" value="'. $val['id'] .'"></th>
									<th>'. $val['id'] .'</th>
									<th><img src="'. $val['img'] .'"></th>
									<th>'. mb_substr($cUser['username'], 0,10,'utf8') .'</th>
									<th>'. mb_substr($val['title'], 0,10,'utf8') .'</th>
									<th>'. mb_substr($val['describe'], 0,15,'utf8') .' ....</th>
									<th>'. mb_substr($val['content'], 0,15,'utf8') .' ....</th>
									<th>'. $slide .'</th>
									<th>
										<a class="state" href="javascript:;">'. $state .'</a>
									</th>
									<th class="handle">
			                          <a href="./index.php?param=article_update&id='. $val['id'] .'">编辑</a>
			                          <a href="javascript:;" onclick="return UI.hintCon({\'url\':\'./pose/article_deleteAction.php?id='. $val['id'] .'\'});">删除</a>
									</th>
								</tr>';
						}
					?>
					
				</tbody>
			</table>
		</div>

		<!-- page 分页模块 -->
		<div class="mypage clearBoth">
			<?php
				if($maxPage > 1){
					echo strPage($page, $maxPage, $key, 'article_lists');
				}
			?>
			<p>共有：<span><?php echo $count;?></span>&nbsp条数据</p>
		</div>
	</div>
</body>
</html>